package com.jekun.helloworld.designmode.memento.demo1;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author Administrator
 */
@Getter
@Setter
@ToString
public class UserInfoDTO {
    private String account;
    private String password;
    private String telNo;

    public Memento saveMemento() {
        return new Memento(account, password, telNo);
    }

    public void restoreMemento(Memento memento) {
        this.account = memento.getAccount();
        this.password = memento.getPassword();
        this.telNo = memento.getTelNo();
    }

    public void show() {
        System.out.println("Account:" + this.account);
        System.out.println("Password:" + this.password);
        System.out.println("TelNo:" + this.telNo);
    }
}